home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / necko / nsIRequestObserver.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  4KB  |  128 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIRequestObserver.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIRequestObserver_h__
  6. #define __gen_nsIRequestObserver_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIRequest; /* forward declaration */
  18.  
  19.  
  20. /* starting interface:    nsIRequestObserver */
  21. #define NS_IREQUESTOBSERVER_IID_STR "fd91e2e0-1481-11d3-9333-00104ba0fd40"
  22.  
  23. #define NS_IREQUESTOBSERVER_IID \
  24.   {0xfd91e2e0, 0x1481, 0x11d3, \
  25.     { 0x93, 0x33, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40 }}
  26.  
  27. /**
  28.  * nsIRequestObserver
  29.  *
  30.  * @status FROZEN
  31.  */
  32. class NS_NO_VTABLE nsIRequestObserver : public nsISupports {
  33.  public: 
  34.  
  35.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IREQUESTOBSERVER_IID)
  36.  
  37.   /**
  38.      * Called to signify the beginning of an asynchronous request.
  39.      *
  40.      * @param aRequest request being observed
  41.      * @param aContext user defined context
  42.      *
  43.      * An exception thrown from onStartRequest has the side-effect of
  44.      * causing the request to be canceled.
  45.      */
  46.   /* void onStartRequest (in nsIRequest aRequest, in nsISupports aContext); */
  47.   NS_IMETHOD OnStartRequest(nsIRequest *aRequest, nsISupports *aContext) = 0;
  48.  
  49.   /**
  50.      * Called to signify the end of an asynchronous request.  This
  51.      * call is always preceded by a call to onStartRequest.
  52.      *
  53.      * @param aRequest request being observed
  54.      * @param aContext user defined context
  55.      * @param aStatusCode reason for stopping (NS_OK if completed successfully)
  56.      *
  57.      * An exception thrown from onStopRequest is generally ignored.
  58.      */
  59.   /* void onStopRequest (in nsIRequest aRequest, in nsISupports aContext, in nsresult aStatusCode); */
  60.   NS_IMETHOD OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatusCode) = 0;
  61.  
  62. };
  63.  
  64. /* Use this macro when declaring classes that implement this interface. */
  65. #define NS_DECL_NSIREQUESTOBSERVER \
  66.   NS_IMETHOD OnStartRequest(nsIRequest *aRequest, nsISupports *aContext); \
  67.   NS_IMETHOD OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatusCode); 
  68.  
  69. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  70. #define NS_FORWARD_NSIREQUESTOBSERVER(_to) \
  71.   NS_IMETHOD OnStartRequest(nsIRequest *aRequest, nsISupports *aContext) { return _to OnStartRequest(aRequest, aContext); } \
  72.   NS_IMETHOD OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatusCode) { return _to OnStopRequest(aRequest, aContext, aStatusCode); } 
  73.  
  74. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  75. #define NS_FORWARD_SAFE_NSIREQUESTOBSERVER(_to) \
  76.   NS_IMETHOD OnStartRequest(nsIRequest *aRequest, nsISupports *aContext) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnStartRequest(aRequest, aContext); } \
  77.   NS_IMETHOD OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatusCode) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnStopRequest(aRequest, aContext, aStatusCode); } 
  78.  
  79. #if 0
  80. /* Use the code below as a template for the implementation class for this interface. */
  81.  
  82. /* Header file */
  83. class nsRequestObserver : public nsIRequestObserver
  84. {
  85. public:
  86.   NS_DECL_ISUPPORTS
  87.   NS_DECL_NSIREQUESTOBSERVER
  88.  
  89.   nsRequestObserver();
  90.  
  91. private:
  92.   ~nsRequestObserver();
  93.  
  94. protected:
  95.   /* additional members */
  96. };
  97.  
  98. /* Implementation file */
  99. NS_IMPL_ISUPPORTS1(nsRequestObserver, nsIRequestObserver)
  100.  
  101. nsRequestObserver::nsRequestObserver()
  102. {
  103.   /* member initializers and constructor code */
  104. }
  105.  
  106. nsRequestObserver::~nsRequestObserver()
  107. {
  108.   /* destructor code */
  109. }
  110.  
  111. /* void onStartRequest (in nsIRequest aRequest, in nsISupports aContext); */
  112. NS_IMETHODIMP nsRequestObserver::OnStartRequest(nsIRequest *aRequest, nsISupports *aContext)
  113. {
  114.     return NS_ERROR_NOT_IMPLEMENTED;
  115. }
  116.  
  117. /* void onStopRequest (in nsIRequest aRequest, in nsISupports aContext, in nsresult aStatusCode); */
  118. NS_IMETHODIMP nsRequestObserver::OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatusCode)
  119. {
  120.     return NS_ERROR_NOT_IMPLEMENTED;
  121. }
  122.  
  123. /* End of implementation class template. */
  124. #endif
  125.  
  126.  
  127. #endif /* __gen_nsIRequestObserver_h__ */
  128.